package com.yixinsoft.basic.web.controller.manage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.yixinsoft.basic.model.manage.system.User;
import com.yixinsoft.basic.service.manage.system.ResourceService;
import com.yixinsoft.basic.web.bind.annotation.CurrentUser;


/**
 * Created by hqy on 2016/06/07
 */
@Controller
@RequestMapping("/manage")
public class IndexController {
	
	@Autowired
	private ResourceService resourceService;

	@RequestMapping(method = RequestMethod.GET)
	public String index(@CurrentUser User loginUser, Model model) {
		model.addAttribute("menus", resourceService.findMenus(loginUser));
		return "manage/index/index";
	}
	
	@RequestMapping("/welcome")
	public String welcome() {
		return "welcome";
	}
}
